package edu.cmu.cs.stage3.alice.authoringtool.datatransfer;

/**
 * @author Jason Pratt
 */
public class CallToUserDefinedQuestionPrototypeReferenceTransferable extends QuestionPrototypeReferenceTransferable {

        //LOB version using 'mimeType' to create 'java.awt.datatransfer.DataFlavor' produce error in Java 5, changed to 'Class'

	//LOB public final static java.awt.datatransfer.DataFlavor callToUserDefinedQuestionPrototypeReferenceFlavor = new java.awt.datatransfer.DataFlavor( java.awt.datatransfer.DataFlavor.javaJVMLocalObjectMimeType + "; class=edu.cmu.cs.stage3.alice.authoringtool.util.CallToUserDefinedQuestionPrototype", "callToUserDefinedQuestionPrototypeReferenceFlavor" );
        public static java.awt.datatransfer.DataFlavor callToUserDefinedQuestionPrototypeReferenceFlavor = null;
        static { try {
	   String str = java.awt.datatransfer.DataFlavor.javaJVMLocalObjectMimeType + "; class=edu.cmu.cs.stage3.alice.authoringtool.util.CallToUserDefinedQuestionPrototype";
	   // callToUserDefinedQuestionPrototypeReferenceFlavor = new java.awt.datatransfer.DataFlavor( str, "callToUserDefinedQuestionPrototypeReferenceFlavor" );
   	   callToUserDefinedQuestionPrototypeReferenceFlavor = new java.awt.datatransfer.DataFlavor(edu.cmu.cs.stage3.alice.authoringtool.util.CallToUserDefinedQuestionPrototype.class, "callToUserDefinedQuestionPrototypeReferenceFlavor" );
           } catch(Exception e) { System.err.println("Error: CallToUserDefinedQuestionPrototypeReferenceTransferable.java: "+e.toString()); }
	   }
        //LOB version using 'mimeType' to create 'java.awt.datatransfer.DataFlavor' produce error in Java 5, changed to 'Class'   

	protected edu.cmu.cs.stage3.alice.authoringtool.util.CallToUserDefinedQuestionPrototype callToUserDefinedQuestionPrototype;

	public CallToUserDefinedQuestionPrototypeReferenceTransferable( edu.cmu.cs.stage3.alice.authoringtool.util.CallToUserDefinedQuestionPrototype callToUserDefinedQuestionPrototype ) {
		super( callToUserDefinedQuestionPrototype );
		this.callToUserDefinedQuestionPrototype = callToUserDefinedQuestionPrototype;

		flavors = new java.awt.datatransfer.DataFlavor[4];
		flavors[0] = callToUserDefinedQuestionPrototypeReferenceFlavor;
		flavors[1] = QuestionPrototypeReferenceTransferable.questionPrototypeReferenceFlavor;
		flavors[2] = ElementPrototypeReferenceTransferable.elementPrototypeReferenceFlavor;
		flavors[3] = java.awt.datatransfer.DataFlavor.stringFlavor;
	}

	//Rem @Override
	public Object getTransferData( java.awt.datatransfer.DataFlavor flavor ) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException {
		if( flavor.equals( callToUserDefinedQuestionPrototypeReferenceFlavor ) ) {
			return callToUserDefinedQuestionPrototype;
		} else if( flavor.equals( QuestionPrototypeReferenceTransferable.questionPrototypeReferenceFlavor ) ) {
			return callToUserDefinedQuestionPrototype;
		} else if( flavor.equals( ElementPrototypeReferenceTransferable.elementPrototypeReferenceFlavor ) ) {
			return callToUserDefinedQuestionPrototype;
		} else if( flavor.equals( java.awt.datatransfer.DataFlavor.stringFlavor ) ) {
			return callToUserDefinedQuestionPrototype.toString();
		} else {
			throw new java.awt.datatransfer.UnsupportedFlavorException( flavor );
		}
	}
}
